package edu.thu.studio.ormdesigner.outline.editpart;

import java.beans.PropertyChangeEvent;
import java.util.ArrayList;
import java.util.List;

import edu.thu.studio.ormdesigner.model.AbstractModel;
import edu.thu.studio.ormdesigner.model.ORMModel;

public class ORMModelOutlineEditPart extends AbstractOutlineEditPart {
    
    /**
     * {@inheritDoc}
     */
    @Override
    @SuppressWarnings({"rawtypes", "unchecked"})
    protected List getModelChildren() {
        List modelChildren = new ArrayList<AbstractModel>();
        ORMModel model = (ORMModel) this.getModel();
        modelChildren.add(model.getDomains());
        modelChildren.add(model.getDiagrams());
        return modelChildren;
    }
    
    @Override
    public void propertyChange(PropertyChangeEvent event) {
        if (event.getPropertyName().equals("refreshOutline")) {
            this.refreshOutline();
            
        } else if (event.getPropertyName().equals("refreshChildren")) {
            this.refreshOutline();
            
        } else if (event.getPropertyName().equals("refresh")) {
            this.refreshOutline();
            
        } else if (event.getPropertyName().equals("refreshVisuals")) {
            this.refreshOutline();
            
        } else if (event.getPropertyName().equals("refreshSettings")) {
            this.refreshOutline();
            
        }
    }
    
    /**
     * {@inheritDoc}
     */
    @Override
    protected void refreshOutlineVisuals() {
    }
}
